Due to their biocompatibility, titanium and titanium alloys are used in a variety of biomedical devices, including orthopedic and dental implants. Titanium and titanium alloys are ideally suited to such applications because they are not only corrosion resistant, but also have the ability to be integrated into bone. Titanium can be subjected to surface modification to alter its biocompatibility, for example by electrochemical etching. Electrochemical etching generates nanotubes of titanium oxide. Electrochemical etching and other modifications can be used to modulate the hydrophobicity/hydrophilicity of the surface. Enhancing hydrophobicity results in a surface that is not easily wettable and sheds water. Enhancing hydrophilicity results in a surface that is wettable and supports cell growth. For example, titania nanotubes can be produced by etching titanium foil in an aqueous electrolyte containing fluoride ions. Conventional methods use a two-electrode DC anodization process that is carried out in a vessel containing an aqueous electrolyte containing fluoride ions, such as hydrofluoric acid, with the titanium foil acting as the working anode, and a platinum mesh acting as the cathode. Conventional methods have proved unsatisfactory because they typically require the use of expensive metals, such as platinum, and/or hazardous chemicals, such as hydrofluoric acid, as a fluoride ion source. Moreover, their commercial applicability is limited because they are most suitable for the uniform modification of small flat titanium foils. Improved methods for modifying surfaces having complex geometries are urgently required for use in orthopedic and dental applications. Advantageously, such methods would provide for the selective modification of portions of the surface using non-hazardous electrolytes and inexpensive electrodes.